package lab02.test06;

public class Triangle {
    //属性
    double a1;
    double a2;
    double a3;
    double perimeter;
    double area;
    boolean x;
    //行为
    double alter(double x,double y,double z){
        a1=x;
        a2=y;
        a3=z;
        return 0;
    }
    void triangle() {
        if (a1 + a2 > a3) {
            x = true;
        } else x = false;
    }


    double getPerimeter(){
        return  a1+a2+a3;
    }
    double getArea(){
        double p=0.5*(a1+a2+a3);
        return Math.sqrt(p*(p-a1)*(p-a2)*(p-a3));
    }

}
